import React, { useState } from "react";
import ReactQuill from "react-quill-new";
import "react-quill-new/dist/quill.snow.css";

const QuillDemo: React.FC = () => {
  const [value, setValue] = useState("");

  return (
    <div>
      <div className="text-xl mb-4">React Quill 最简单示例</div>
      <ReactQuill theme="snow" value={value} onChange={setValue} />
      <div style={{ marginTop: 16 }}>
        <b>内容预览：</b>
        <div style={{ border: "1px solid #eee", minHeight: 50, padding: 8 }}>
          <div dangerouslySetInnerHTML={{ __html: value }} />
        </div>
      </div>
    </div>
  );
};

export default QuillDemo;
